package com.biodiv.miracle.ioc.factory;

import com.biodiv.miracle.ioc.context.ApplicationContext;
import com.biodiv.miracle.ioc.scanner.ClasspathScanner;

import java.util.Collection;
import java.util.List;

/**
 * @author tianquan
 */
public abstract class FactoryBeanRegister {

    private final ClasspathScanner classpathScanner = new ClasspathScanner();

    /**
     * scanFactoryBean
     *
     * @param mianClass 启动类
     * @ param applicationContext 容器上下文
     * @return 三方工厂bean
     */
    public abstract Collection<FactoryBean<?>> scanFactoryBean(Class<?> mianClass, ApplicationContext applicationContext);

    public List<Class<?>> loadClass(String packageName) {
        return classpathScanner.loadClass(packageName);
    }

}
